package cn.tedu._03mybatis.mapper;

import cn.tedu._03mybatis.pojo.entity.WeiBo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface WeiBoMapper {
    @Insert("INSERT INTO weibo(id,content,created,user_id) VALUES (#{id},#{content},#{created},#{user_id})")
    int insertWeiBo(WeiBo weiBo);

    @Delete("DELETE FROM weibo WHERE id=#{id}")
    int deleteWeibo(long id);
    //只能更新内容和时间
    @Update("UPDATE weibo SET content=#{content},created=#{created} WHERE id=#{id}")
    int updateWeiboId(WeiBo weiBo);
}
